package com.wry.controller;

import com.wry.entity.WOrder;
import com.wry.service.OrderProducerService;
import com.wry.util.ApiResult;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <h1>  <h1>
 *
 * @author 魏如元
 * @since 2022/10/14
 */
@RestController
@RequestMapping("producer/order")
public class MqProducerController {

    @Resource
    private OrderProducerService orderProducerService;

    /**
     * 创建订单
     */
    @PostMapping("create")
    public ApiResult<String> createOder(@RequestBody WOrder order){
        orderProducerService.createOrder(order);
        return ApiResult.SUCCESS("订单创建成功！");
    }

    /**
     * 创建订单
     */
    @PostMapping("pay/{orderId}")
    public ApiResult<String> createOder(@PathVariable("orderId") String orderId){

        return ApiResult.SUCCESS("订单支付成功！");
    }
}
